#ifndef BANK_TRANSACTION_HH
#define BANK_TRANSACTION_HH

#include <string>
#include <ctime>

enum class TransactionType {
    DEPOSIT,
    WITHDRAW,
    TRANSFER,
    CURRENCY_EXCHANGE
};

// 前向声明Currency枚举 (已在Account.hh中定义)
enum class Currency;

class Transaction {
public:
    std::string transactionId;
    TransactionType type;
    double amount;
    time_t timestamp;
    std::string sourceAccountId; // Can be empty for deposit
    std::string destinationAccountId; // Can be empty for withdrawal
    std::string note;
    Currency currency; // 添加货币类型字段

    Transaction(
        std::string id,
        TransactionType type,
        double amount,
        const std::string& sourceId,
        const std::string& destId,
        const std::string& note
    );
    
    // 添加带货币类型的构造函数
    Transaction(
        std::string id,
        TransactionType type,
        double amount,
        const std::string& sourceId,
        const std::string& destId,
        const std::string& note,
        Currency currency
    );

    // Method to display transaction details
    void display() const;
    std::string getTypeString() const;
};

#endif // BANK_TRANSACTION_HH 